package com.ctcemti.mdm.project.sys.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
import com.ctcemti.mdm.project.sys.entity.formdata.BaseReq;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;

@Data
@ApiModel(value= "岗位职责表")
public class OrgJob  extends BaseReq implements IExcelModel,IExcelDataModel,Comparable<OrgJob> {

    /**
     * id
     */
    @Id
    @ApiModelProperty(value = "主键id",required = true)
    private String id;

    /**
     * 职责编号
     */
    @ApiModelProperty(value = "职责编号")
    @Excel(name="职责编号")
    private String code;


    /**
     * 职责名称
     */
    @ApiModelProperty(value = "职责名称")
    @Excel(name="职责名称")
    private String name;

    /**
     * 所属岗位
     */
    @ApiModelProperty(value = "所属岗位")
    @Excel(name="所属岗位")
    private String job;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    @Excel(name="描述")
    private String description;

    /**
     *
     */
    @ApiModelProperty(value = "创建人")
    private String creator;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    private Date createDate;

    /**
     * 修改人
     */
    @ApiModelProperty(value = "修改人")
    private String modifiedBy;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    private Date modifyDate;

    @Transient
    private String jobName;


    @Transient
    @Excel(name = "错误提示")
    @ApiModelProperty(hidden = true)//swagger忽略属性
    private String errorMsg;

    @Transient
    @ApiModelProperty(hidden = true)//swagger忽略属性
    private int rowNum;

    @Override
    public int compareTo(OrgJob orgJob) {           //重写Comparable接口的compareTo方法，
        return this.rowNum - orgJob.getRowNum();// 根据行号升序排列，降序修改相减顺序即可
    }


}
